<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <div v-if="teacher">
        <h2 class="jh-entity-heading" data-cy="teacherDetailsHeading"><span>Teacher</span> {{ teacher.id }}</h2>
        <dl class="row jh-entity-details">
          <dt>
            <span>Teacher Account</span>
          </dt>
          <dd>
            <span>{{ teacher.teacherAccount }}</span>
          </dd>
          <dt>
            <span>Teacher Name</span>
          </dt>
          <dd>
            <span>{{ teacher.teacherName }}</span>
          </dd>
          <dt>
            <span>Teacher Status</span>
          </dt>
          <dd>
            <span>{{ teacher.teacherStatus }}</span>
          </dd>
          <dt>
            <span>Teacher Password</span>
          </dt>
          <dd>
            <span>{{ teacher.teacherPassword }}</span>
          </dd>
          <dt>
            <span>User Class</span>
          </dt>
          <dd>
            <span v-for="(userClass, i) in teacher.userClasses" :key="userClass.id"
              >{{ i > 0 ? ', ' : '' }}
              <router-link :to="{ name: 'UserClassView', params: { userClassId: userClass.id } }">{{ userClass.id }}</router-link>
            </span>
          </dd>
        </dl>
        <button type="submit" v-on:click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span> Back</span>
        </button>
        <router-link v-if="teacher.id" :to="{ name: 'TeacherEdit', params: { teacherId: teacher.id } }" custom v-slot="{ navigate }">
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span> Edit</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./teacher-details.component.ts"></script>
